3.4.1 \(\int \frac {\cos ^7(x)}{a+b \sin ^2(x)} \, dx\) [301]

Optimal. Leaf size=78 \[ \frac {(a+b)^3 \tan ^{-1}\left (\frac {\sqrt {b} \sin (x)}{\sqrt {a}}\right )}{\sqrt {a} b^{7/2}}-\frac {\left (a^2+3 a b+3 b^2\right ) \sin (x)}{b^3}+\frac {(a+3 b) \sin ^3(x)}{3 b^2}-\frac {\sin ^5(x)}{5 b} \]

[Out]

-(a^2+3*a*b+3*b^2)*sin(x)/b^3+1/3*(a+3*b)*sin(x)^3/b^2-1/5*sin(x)^5/b+(a+b)^3*arctan(sin(x)*b^(1/2)/a^(1/2))/b
^(7/2)/a^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 78, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3269, 398, 211} \begin {gather*} -\frac {\left (a^2+3 a b+3 b^2\right ) \sin (x)}{b^3}+\frac {(a+b)^3 \text {ArcTan}\left (\frac {\sqrt {b} \sin (x)}{\sqrt {a}}\right )}{\sqrt {a} b^{7/2}}+\frac {(a+3 b) \sin ^3(x)}{3 b^2}-\frac {\sin ^5(x)}{5 b} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[x]^7/(a + b*Sin[x]^2),x]

[Out]

((a + b)^3*ArcTan[(Sqrt[b]*Sin[x])/Sqrt[a]])/(Sqrt[a]*b^(7/2)) - ((a^2 + 3*a*b + 3*b^2)*Sin[x])/b^3 + ((a + 3*
b)*Sin[x]^3)/(3*b^2) - Sin[x]^5/(5*b)

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 398

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Int[PolynomialDivide[(a + b*x^n)
^p, (c + d*x^n)^(-q), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && IGtQ[p, 0] && ILt
Q[q, 0] && GeQ[p, -q]

Rule 3269

Int[cos[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*(a + b*ff^2*x^2)^p, x], x, Sin[e +
f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps

\begin {align*} \int \frac {\cos ^7(x)}{a+b \sin ^2(x)} \, dx &=\text {Subst}\left (\int \frac {\left (1-x^2\right )^3}{a+b x^2} \, dx,x,\sin (x)\right )\\ &=\text {Subst}\left (\int \left (-\frac {a^2+3 a b+3 b^2}{b^3}+\frac {(a+3 b) x^2}{b^2}-\frac {x^4}{b}+\frac {a^3+3 a^2 b+3 a b^2+b^3}{b^3 \left (a+b x^2\right )}\right ) \, dx,x,\sin (x)\right )\\ &=-\frac {\left (a^2+3 a b+3 b^2\right ) \sin (x)}{b^3}+\frac {(a+3 b) \sin ^3(x)}{3 b^2}-\frac {\sin ^5(x)}{5 b}+\frac {(a+b)^3 \text {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\sin (x)\right )}{b^3}\\ &=\frac {(a+b)^3 \tan ^{-1}\left (\frac {\sqrt {b} \sin (x)}{\sqrt {a}}\right )}{\sqrt {a} b^{7/2}}-\frac {\left (a^2+3 a b+3 b^2\right ) \sin (x)}{b^3}+\frac {(a+3 b) \sin ^3(x)}{3 b^2}-\frac {\sin ^5(x)}{5 b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.20, size = 109, normalized size = 1.40 \begin {gather*} \frac {-120 (a+b)^3 \tan ^{-1}\left (\frac {\sqrt {a} \csc (x)}{\sqrt {b}}\right )+120 (a+b)^3 \tan ^{-1}\left (\frac {\sqrt {b} \sin (x)}{\sqrt {a}}\right )-2 \sqrt {a} \sqrt {b} \left (120 a^2+340 a b+309 b^2+4 b (5 a+12 b) \cos (2 x)+3 b^2 \cos (4 x)\right ) \sin (x)}{240 \sqrt {a} b^{7/2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[x]^7/(a + b*Sin[x]^2),x]

[Out]

(-120*(a + b)^3*ArcTan[(Sqrt[a]*Csc[x])/Sqrt[b]] + 120*(a + b)^3*ArcTan[(Sqrt[b]*Sin[x])/Sqrt[a]] - 2*Sqrt[a]*
Sqrt[b]*(120*a^2 + 340*a*b + 309*b^2 + 4*b*(5*a + 12*b)*Cos[2*x] + 3*b^2*Cos[4*x])*Sin[x])/(240*Sqrt[a]*b^(7/2
))

________________________________________________________________________________________

Maple [A]
time = 0.33, size = 91, normalized size = 1.17

method result size
default \(-\frac {\frac {\left (\sin ^{5}\left (x \right )\right ) b^{2}}{5}-\frac {a b \left (\sin ^{3}\left (x \right )\right )}{3}-b^{2} \left (\sin ^{3}\left (x \right )\right )+a^{2} \sin \left (x \right )+3 a b \sin \left (x \right )+3 b^{2} \sin \left (x \right )}{b^{3}}+\frac {\left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right ) \arctan \left (\frac {b \sin \left (x \right )}{\sqrt {a b}}\right )}{b^{3} \sqrt {a b}}\) \(91\)
risch \(\frac {i {\mathrm e}^{i x} a^{2}}{2 b^{3}}+\frac {11 i {\mathrm e}^{i x} a}{8 b^{2}}+\frac {19 i {\mathrm e}^{i x}}{16 b}-\frac {i {\mathrm e}^{-i x} a^{2}}{2 b^{3}}-\frac {11 i {\mathrm e}^{-i x} a}{8 b^{2}}-\frac {19 i {\mathrm e}^{-i x}}{16 b}-\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {-a b}}-1\right ) a^{3}}{2 \sqrt {-a b}\, b^{3}}-\frac {3 \ln \left ({\mathrm e}^{2 i x}-\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {-a b}}-1\right ) a^{2}}{2 \sqrt {-a b}\, b^{2}}-\frac {3 \ln \left ({\mathrm e}^{2 i x}-\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {-a b}}-1\right ) a}{2 \sqrt {-a b}\, b}-\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {-a b}}-1\right )}{2 \sqrt {-a b}}+\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {-a b}}-1\right ) a^{3}}{2 \sqrt {-a b}\, b^{3}}+\frac {3 \ln \left ({\mathrm e}^{2 i x}+\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {-a b}}-1\right ) a^{2}}{2 \sqrt {-a b}\, b^{2}}+\frac {3 \ln \left ({\mathrm e}^{2 i x}+\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {-a b}}-1\right ) a}{2 \sqrt {-a b}\, b}+\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {-a b}}-1\right )}{2 \sqrt {-a b}}-\frac {\sin \left (5 x \right )}{80 b}-\frac {3 \sin \left (3 x \right )}{16 b}-\frac {\sin \left (3 x \right ) a}{12 b^{2}}\) \(384\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)^7/(a+b*sin(x)^2),x,method=_RETURNVERBOSE)

[Out]

-1/b^3*(1/5*sin(x)^5*b^2-1/3*a*b*sin(x)^3-b^2*sin(x)^3+a^2*sin(x)+3*a*b*sin(x)+3*b^2*sin(x))+(a^3+3*a^2*b+3*a*
b^2+b^3)/b^3/(a*b)^(1/2)*arctan(b*sin(x)/(a*b)^(1/2))

________________________________________________________________________________________

Maxima [A]
time = 0.50, size = 86, normalized size = 1.10 \begin {gather*} \frac {{\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \arctan \left (\frac {b \sin \left (x\right )}{\sqrt {a b}}\right )}{\sqrt {a b} b^{3}} - \frac {3 \, b^{2} \sin \left (x\right )^{5} - 5 \, {\left (a b + 3 \, b^{2}\right )} \sin \left (x\right )^{3} + 15 \, {\left (a^{2} + 3 \, a b + 3 \, b^{2}\right )} \sin \left (x\right )}{15 \, b^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^7/(a+b*sin(x)^2),x, algorithm="maxima")

[Out]

(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*arctan(b*sin(x)/sqrt(a*b))/(sqrt(a*b)*b^3) - 1/15*(3*b^2*sin(x)^5 - 5*(a*b + 3
*b^2)*sin(x)^3 + 15*(a^2 + 3*a*b + 3*b^2)*sin(x))/b^3

________________________________________________________________________________________

Fricas [A]
time = 0.43, size = 233, normalized size = 2.99 \begin {gather*} \left [-\frac {15 \, {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \sqrt {-a b} \log \left (-\frac {b \cos \left (x\right )^{2} + 2 \, \sqrt {-a b} \sin \left (x\right ) + a - b}{b \cos \left (x\right )^{2} - a - b}\right ) + 2 \, {\left (3 \, a b^{3} \cos \left (x\right )^{4} + 15 \, a^{3} b + 40 \, a^{2} b^{2} + 33 \, a b^{3} + {\left (5 \, a^{2} b^{2} + 9 \, a b^{3}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}{30 \, a b^{4}}, \frac {15 \, {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \sqrt {a b} \arctan \left (\frac {\sqrt {a b} \sin \left (x\right )}{a}\right ) - {\left (3 \, a b^{3} \cos \left (x\right )^{4} + 15 \, a^{3} b + 40 \, a^{2} b^{2} + 33 \, a b^{3} + {\left (5 \, a^{2} b^{2} + 9 \, a b^{3}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}{15 \, a b^{4}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^7/(a+b*sin(x)^2),x, algorithm="fricas")

[Out]

[-1/30*(15*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*sqrt(-a*b)*log(-(b*cos(x)^2 + 2*sqrt(-a*b)*sin(x) + a - b)/(b*cos(x
)^2 - a - b)) + 2*(3*a*b^3*cos(x)^4 + 15*a^3*b + 40*a^2*b^2 + 33*a*b^3 + (5*a^2*b^2 + 9*a*b^3)*cos(x)^2)*sin(x
))/(a*b^4), 1/15*(15*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*sqrt(a*b)*arctan(sqrt(a*b)*sin(x)/a) - (3*a*b^3*cos(x)^4
+ 15*a^3*b + 40*a^2*b^2 + 33*a*b^3 + (5*a^2*b^2 + 9*a*b^3)*cos(x)^2)*sin(x))/(a*b^4)]

________________________________________________________________________________________

Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)**7/(a+b*sin(x)**2),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]
time = 0.47, size = 98, normalized size = 1.26 \begin {gather*} \frac {{\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \arctan \left (\frac {b \sin \left (x\right )}{\sqrt {a b}}\right )}{\sqrt {a b} b^{3}} - \frac {3 \, b^{4} \sin \left (x\right )^{5} - 5 \, a b^{3} \sin \left (x\right )^{3} - 15 \, b^{4} \sin \left (x\right )^{3} + 15 \, a^{2} b^{2} \sin \left (x\right ) + 45 \, a b^{3} \sin \left (x\right ) + 45 \, b^{4} \sin \left (x\right )}{15 \, b^{5}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^7/(a+b*sin(x)^2),x, algorithm="giac")

[Out]

(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*arctan(b*sin(x)/sqrt(a*b))/(sqrt(a*b)*b^3) - 1/15*(3*b^4*sin(x)^5 - 5*a*b^3*si
n(x)^3 - 15*b^4*sin(x)^3 + 15*a^2*b^2*sin(x) + 45*a*b^3*sin(x) + 45*b^4*sin(x))/b^5

________________________________________________________________________________________

Mupad [B]
time = 0.12, size = 99, normalized size = 1.27 \begin {gather*} {\sin \left (x\right )}^3\,\left (\frac {a}{3\,b^2}+\frac {1}{b}\right )-\sin \left (x\right )\,\left (\frac {3}{b}+\frac {a\,\left (\frac {a}{b^2}+\frac {3}{b}\right )}{b}\right )-\frac {{\sin \left (x\right )}^5}{5\,b}+\frac {\mathrm {atan}\left (\frac {\sqrt {b}\,\sin \left (x\right )\,{\left (a+b\right )}^3}{\sqrt {a}\,\left (a^3+3\,a^2\,b+3\,a\,b^2+b^3\right )}\right )\,{\left (a+b\right )}^3}{\sqrt {a}\,b^{7/2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)^7/(a + b*sin(x)^2),x)

[Out]

sin(x)^3*(a/(3*b^2) + 1/b) - sin(x)*(3/b + (a*(a/b^2 + 3/b))/b) - sin(x)^5/(5*b) + (atan((b^(1/2)*sin(x)*(a +
b)^3)/(a^(1/2)*(3*a*b^2 + 3*a^2*b + a^3 + b^3)))*(a + b)^3)/(a^(1/2)*b^(7/2))

________________________________________________________________________________________